package shuiyuqing.views.adapters;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.xkh.xkh.R;

import java.util.ArrayList;

import com.xkh.xkh.MyApplication;
import shuiyuqing.model.BasicInfoModel;
import shuiyuqing.network.beans.IrrBTCanalDetail;

/**
 * Created by 凯 on 2015/11/7.
 */
@Deprecated
public class CannelAdapter extends BaseAdapter {

    // 所有渠道
    ArrayList<IrrBTCanalDetail> details = (ArrayList<IrrBTCanalDetail>) BasicInfoModel.getAllCannal();

    @Override
    public int getCount() {
        return details.size();
    }

    @Override
    public Object getItem(int position) {
        return details.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        IrrBTCanalDetail detail = details.get(position);
        convertView = View.inflate(MyApplication.share(), R.layout.item_sel_cannel,null);
        TextView tv_cannelName = (TextView) convertView.findViewById(R.id.id_tv_cannelName);
        tv_cannelName.setText(detail.getCanalName());
        convertView.setTag(R.id.id_cannel,detail);
        return convertView;
    }
}
